]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inputMethod: Pass tracked object to connectObject() calls
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 3 Sep 2026 17:51:52 +0000 (19:51 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 13 Sep 2026 17:39:10 +0000 (19:39 +0200)
Otherwise the handler will be associated with the `globalThis`
object and never get disconnected automatically.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4382>
(cherry picked from commit 1579879c666448c090d2009c98cb3840c7811652)

js/misc/inputMethod.js

index 4d123c31f2256a218b8e4b03ae9754e034d83d0d..806a9f380397a8ad950d1f21f019fe9635541f44 100644 (file)
@@ -93,7 +93,9 @@ export const InputMethod = GObject.registerClass({
         if (HAVE_REQUIRE_SURROUNDING_TEXT)
             this._context.connect('require-surrounding-text', this._onRequireSurroundingText.bind(this));
 
-        Main.keyboard.connectObject('visibility-changed', () => this._updateCapabilities());
+        Main.keyboard.connectObject(
+            'visibility-changed', () => this._updateCapabilities(),
+            this);
 
         this._updateCapabilities();
     }